# !/usr/bin/env python
# !-*-coding:utf-8 -*-
# !@TIME: 
# !@Author : Destroy丶寒露
# !@File :.py

import json,pymysql

def getconnect():
    f = open('config.txt',mode='r',encoding='utf-8')
    f_t = f.read()
    f.close()
    config = json.loads(f_t)
    conn = pymysql.Connect(host=config['host'], port=config['port'], user=config['username'], password=config['password'], db=config['db'],
                           charset=config['charset'],
                           cursorclass=pymysql.cursors.DictCursor)
    return  conn